﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ionic.Zip;
using System.Net;
using System.IO;

namespace mtdsharp
{
    public partial class LoadingWindow : Form
    {
        private WebClient webClient;

        public LoadingWindow()
        {
            InitializeComponent();
        }

        private void LoadingWindow_Load(object sender, EventArgs e)
        {
        }

        private void loadingTimer_Tick(object sender, EventArgs e)
        {
            webClient = new WebClient();
            webClient.DownloadFile("http://developer.cumtd.com/gtfs/google_transit.zip", "google_transit.zip");

            using (ZipFile zip = ZipFile.Read("google_transit.zip"))
            {
                foreach (ZipEntry entry in zip)
                {
                    entry.Extract();
                }
            }
            this.Close();
        }
    }
}
